package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.model.dto.dorimitory.DormitoryQueryRequest;
import com.cyy.springbootinit.model.entity.Dormitory;
import com.cyy.springbootinit.model.vo.DormitoryVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 宿舍服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface DormitoryService extends IService<Dormitory> {

    /**
     * 校验数据
     *
     * @param dormitory
     * @param add 对创建的数据进行校验
     */
    void validDormitory(Dormitory dormitory, boolean add);

    /**
     * 获取查询条件
     *
     * @param dormitoryQueryRequest
     * @return
     */
    QueryWrapper<Dormitory> getQueryWrapper(DormitoryQueryRequest dormitoryQueryRequest);
    
    /**
     * 获取宿舍封装
     *
     * @param dormitory
     * @param request
     * @return
     */
    DormitoryVO getDormitoryVO(Dormitory dormitory, HttpServletRequest request);

    /**
     * 分页获取宿舍封装
     *
     * @param dormitoryPage
     * @param request
     * @return
     */
    Page<DormitoryVO> getDormitoryVOPage(Page<Dormitory> dormitoryPage, HttpServletRequest request);
}
